var dropbox;
function init(){ 
	var params = window.arguments[0];
	dropbox = params.dropbox;
}

function printFolder(data){
	//alert(data);
	for (var i=0; i<data.body.contents.length; i++) {
		var listbox = document.getElementById('photoFileList');
		var child1 = document.createElement('listcell');
		child1.setAttribute('label',data.body.contents[i].path);
		var child2 = document.createElement('listcell');
		child2.setAttribute('label',data.body.contents[i].is_dir);
		var item = document.createElement('listitem');
		//item.setAttribute('value',this.cdList[i].getId());
		item.appendChild(child1);
		item.appendChild(child2);
		listbox.appendChild(item);
	}
}
function listPhotoFolder(){

	dropbox.getFolderContents("Photos", printFolder);

}

window.addEventListener("load", function(e) { init();}, false);